#ifndef _IM_SERVER_SHOPKEEPER_CACHE_H_
#define _IM_SERVER_SHOPKEEPER_CACHE_H_

#include <stdint.h>
#include <string>
#include <set>
#include <boost/thread/shared_mutex.hpp>

namespace base {
class SimpleConnectionPool;
};

namespace imserver {

class BangShopKeeperCache {
public:
  static BangShopKeeperCache & Instance() {
    static BangShopKeeperCache cache;
    return cache;
  }

  int Reload();
  bool Contains(int64_t uid) const;
private:
  BangShopKeeperCache();

  BangShopKeeperCache(const BangShopKeeperCache &);
  BangShopKeeperCache& operator=(const BangShopKeeperCache&);

  base::SimpleConnectionPool * db_conn_pool_;

  std::set<int64_t> shopkeepers_;
  mutable boost::shared_mutex mutex_;
};

}

#endif // _IM_SERVER_SHOPKEEPER_CACHE_H_
